/*
 * DataFile.h
 *
 *  Created on: 19 juin 2011
 *      Author: incite
 */

#ifndef DATAFILE_H_
#define DATAFILE_H_

#include <istream>
#include <ostream>
#include "TagCompound.h"

namespace NamedBinaryTag
{

class __attribute__((visibility("default"))) DataFile
{
private:
	TagCompound *rootTag;
	bool compress;
	void LoadData(std::istream &input, ITag *tag);
	void SaveData(std::ostream &output, ITag *tag);
public:
	DataFile();
	DataFile(const DataFile &other);
	virtual ~DataFile();

	TagCompound *get_RootTag() const;
	bool get_Compress() const;
	void set_Compress(bool compress);
	void Load(std::istream &input);
	void Save(std::ostream &output);
	void Init();

	DataFile &operator = (DataFile &other);
};

}

#endif /* DATAFILE_H_ */
